package com.tanhua.sso.controller;

import com.tanhua.sso.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RequestMapping("/user")
@RestController
public class SmsController {

    @Autowired
    private SmsService smsService;

    /**
     * 发送短信验证码
     *
     * @param param
     * @return
     */
    @PostMapping("/login")
    public Object sendCheckCode(@RequestBody Map<String, String> param) {
        String phone = param.get("phone");
        return this.smsService.sendCheckCode(phone);
    }

}
